//Eg3-25.cpp
#include <iostream>
using namespace std;
class MyClass{
    int val;
public:
    MyClass(int i){ val=i; }
    int getval(){ return val; }
    void setval(int i){ val=i; }
};
void display(MyClass  ob){ cout<<ob.getval()<<endl; }
void change1(MyClass  ob){ ob.setval(50); }
void change2(MyClass & ob){ ob.setval(50); }
void change3(MyClass * ob){ ob->setval(100); }

void main(){
    MyClass a(10);
    cout<<"Value of a before calling change  -----";
    display(a);
    change1(a);
    cout<<"Value of a after calling change1()-----";
    display(a);
    change2(a);
    cout<<"Value of a after calling change2()-----";
    display(a);
    change3(&a);
    cout<<"Value of a after calling change3()-----";
    display(a);
}
